<!-- Sidebar Header-->
<div id="side-container">
    <div class="sidebar-header d-flex align-items-center">
        <div id="avatar" class="avatar">
            <a href="user/toUserLook">
                <img :src="pic" class="img-fluid rounded-circle">
            </a>
        </div>
        <div class="title">
            <h1 class="h5">{{realName!=''?realName:userName}}</h1>
            <p>{{deptName}}</p>
        </div>
    </div>
    <!-- Sidebar Navidation Menus--><span class="heading">Main</span>
    <ul class="list-unstyled">
        <li class="active"><a href="/xbjy/common/home"> <i class="icon-home"></i>主页 </a></li>
        <li><a href="#userDropdown" data-toggle="collapse"> <i class="icon-windows"></i>用户列表</a>
            <ul id="userDropdown" class="collapse list-unstyled ">
                <li><a href="/xbjy/user/toUser">查看用户</a></li>
                <li><a href="/xbjy/user/toMyUser">我关注的用户</a></li>
                <li><a href="/xbjy/article/toArticle">发布文章</a></li>
                <li><a href="/xbjy/article/toArticleCollect">我的收藏</a></li>
            </ul>
        </li>
        <!--<li><a href="login.html"> <i class="icon-logout"></i>Login page </a></li>-->

        <li><a href="#depDropdown" data-toggle="collapse"> <i class="icon-windows2"></i>部门列表</a>
            <ul id="depDropdown" class="collapse list-unstyled ">
                <li><a href="/xbjy/dept/toDept">全部部门</a></li>
                <li><a href="/xbjy/meeting/toMeeting">会议系统</a></li>
            </ul>
        </li>

    </ul>
</div>

<script>
    let v_s = new Vue({
        el:'#side-container',
        data:{
            username:'',
            realName:'',
            deptName:'',
            pic:''
        },
        created:function (){
            let loginUser = sessionStorage.getItem("loginUser");
            loginUser = JSON.parse(loginUser);//转换成js对象
            this.username = loginUser.name;
            this.deptName = loginUser.deptName;
            this.realName = loginUser.realName;
            this.pic = loginUser.pic;
        }
    })
</script>